package org.smile.homework01.kevin.WithDrawMoney;

public class CounterManager extends Approver{
    public CounterManager(String name) {
        super(name + "大堂经理");
    }

    WithDrawMoney counter = new CounterManagerWDM();

    //符合金额条件则由此节点审批，超过的将由下一权限节点审批？
    @Override
    public void ProcessRequest(PurchaseRequest request) {
        if(request.getAmount() < 5000){
            System.out.println("取款单号" + request.getID() + "取款" + request.getAmount() + "经过" + this.name + "审批");
            counter.withDrawMoney();
        }
        else{
            successor.ProcessRequest(request);
        }
    }


}

